const mongoose = require("mongoose");

const ListSchema = new mongoose.Schema({
  password: String,
  tel: Number,
  name: String,
  img: String,
  desc: String,
});

const YijianSchema = new mongoose.Schema({
  img: String, //问题图片
});

const ListModel = mongoose.model("list", ListSchema, "list");
const YijianModel = mongoose.model("yijian", YijianSchema, "yijian");

//对话内容表
const xxinSchema = new mongoose.Schema({
  name: String,
  img: String,
  juese: Array,
  userId: {
    type: mongoose.Types.ObjectId,
    ref: ListModel,
  },
});
// const xxinModel = mongoose.model("xxin", xxinSchema, "xxin");
// ListModel.create({
//   tel: 1371111111,
//   password: "123456",
//   img: "",
//   desc: "测试数据",
//   name: "测试数据",
// });
// xxinModel.create({
//     img:'https://ts1.cn.mm.bing.net/th?id=OIP-C.6ZyK9nSZH54IassCkWHzIgAAAA&w=250&h=250&c=8&rs=1&qlt=90&o=6&pid=3.1&rm=2',
//     name:'群聊',
//     userId:'6662e78fa509f265d8b90c14',
//     juese:['qunid']
// })
// xxinModel.create({
//   name: "霍轶",
//   img: "http://8.130.46.189:3000/uploadVCFi1UPM85mSP3XYAByGlnBa.jpg",
//   userId: "6662a393b36a789fec4199d3",
//   juese: ["6662e788ed866c85e1cfee3a"],
// });

// YijianModel.create({
//   // content: "测试数据",
//   img: "测试数据",
//   // phone: "测试数据",
// })
// ListModel.create({
//   tel: "13233332222",
//   password: "123456",
//   img: "阿狸",
//   name: "阿狸",
//   desc: "我爱运动",
// })

const RunSchema = new mongoose.Schema({
  date: String,
  daykm: Number,
  gearing: String,
  kcal: Number,
  time: String,
});
module.exports = {
  ListModel,
  YijianModel,
  RunModel,
};
